package com.biz.primus.model.payment.enums;

import java.util.Objects;

/**
 * Created by defei on 9/22/17.
 */
public enum WechatTradeType {
    JSAPI, NATIVE, APP, MWEB;

    public static WechatTradeType valueOf(PaymentTradeType paymentTradeType) {

        if (paymentTradeType == null) {
            return null;
        }
        for (WechatTradeType wechatTradeType : values()) {
            if (Objects.equals(wechatTradeType.name(), paymentTradeType.getTradeType())) {
                return wechatTradeType;
            }
        }
        return null;
    }
}
